import Duck from 'extensible-duck'
import produce from 'immer'

const initValue = {}

export default new Duck({
  namespace: 'admin',
  store: 'tableForm',
  types: ['RESET'],
  initialState: initValue,
  reducer: produce((draft, action, duck) => {
    switch (action.type) {
      case duck.types.RESET:
        draft = initValue
        break
      default:
        break
    }
  }),
  selectors: {},
  creators: duck => ({
    actionReset: () => ({ type: duck.types.RESET }),
  }),
})
